<?php 
header('Content-type:text/html;charset=UTF-8');
//处理删除
//1.载入数据库
$date = include 'mdb.php';

//2.得到下标，unset删除变量
$id = $_GET['id'];
 // array_shift(array,$id);
unset($date[$id]);
//3.重新写入数据库
// var_dump($date);
$phpCode =var_export($date,true);
file_put_contents('./mdb.php',"<?php \r\n return " .$phpCode ."\r\n?>");
//4.跳转回去

$js=<<<js
<div id="sue" style='display:block;'><div class="alert">提示信息<br />删除成功！2秒后跳转首页若无响应请<a href='liuyanben.php' >点此返回</a></div></div>
js;
echo $js;
echo "<script>setTimeout(function(){window.location.href='liuyanben.php'},2000)</script>";


 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>删除信息</title>
	<link rel="stylesheet" type="text/css" href="css/edit.css" />

</head>
<body>

</body>
</html>